package org.eenie.cartoonist.components.retrofit;

import java.io.IOException;
import java.lang.reflect.Type;
import java.nio.charset.Charset;

import okhttp3.MediaType;
import okhttp3.RequestBody;
import retrofit2.Converter;

/**
 * Created by sll on 2016/3/31.
 * 将请求的数据转化成符合自己规则的格式
 *
 *
 */
public class OrivonRequestBodyConverter<T> implements Converter<T, RequestBody> {

  private Type type;
  private Charset charset;
  private static final MediaType MEDIA_TYPE = MediaType.parse("application/json; charset=UTF-8");

  public OrivonRequestBodyConverter(Type type, Charset charset) {
    this.type = type;
    this.charset = charset;
  }

  @Override
  public RequestBody convert(T value) throws IOException {


    return null;

//    return RequestBody.create(MEDIA_TYPE, JSON.toJSONString(value).getBytes(charset));
  }
}
